<?php

namespace App\Http\Resources;

use Illuminate\Http\Resources\Json\JsonResource;

class AuthorResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    public function toArray($request)
    {
//        dd($request);
        $data = parent::toArray($request);
        $data['img'] = isset($this->img)?get_img_url($this->img):"";
//        $data['position'] = $data['position']?explode(",",$data['position']):"";
//        unset($data['description']);
        return $data;
    }
}
